package com.two.zelin.controller;
//更新订单
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.two.zelin.service.orderService;
import com.two.zelin.service.impl.orderServiceImpl;


@WebServlet("/updateorder.do")
public class UpdateorderServlet extends HttpServlet{

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doPost(req, resp);
	}
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("UTF-8");
		String id = req.getParameter("id");
		String spid = req.getParameter("spid");
		String fukuan = req.getParameter("fukuan");
		String spname = req.getParameter("spname");
		String jage = req.getParameter("jage");
		String zhekou = req.getParameter("zhekou");
		String shouhuo = req.getParameter("shouhuo");
		orderService service = new orderServiceImpl();
		boolean result = service.updateorder(id, spid, fukuan, spname, jage, zhekou, shouhuo);
		
		System.out.println("更新结果：" + result);
		req.getRequestDispatcher("view/zelin/.html").forward(req, resp);
	}
	
}
